473,513 Members | 6,210 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to handle a large drop-down list?

Hi - I'm developing a 'front-desk' app. to be used over the internet.
(SQL-Server back-end).

One of the pages will require the user to select an entry from a large
(~4000) list of 'member names'.

What are the options to reduce the bandwidth load of this? Is there any way
that I can cache the list on the client (and allow them to periodically
'refresh' their local copy?). Or, does anyone have some code for a 'manual'
auto-select option where the user can enter the start of the name (eg.
"Wri") into a textbox and the list will be populated with all matching
names?

The list will be called upon many times a day and is relatively static (~1-2
changes a day).

Thanks for any and all suggestions,

Paul.
Nov 19 '05 #1
3 11114
First off, please, under any circumstances, populate a dropdown list with
4000 items. This will be completely useless to the end user.

One way you can cache something like this, is to put the items in a list in
a javascript file. So store it in an array, whatever. Include the js file in
your .aspx, and pull the list from there. The beauty of js files, is that
every time you open a new browser instance and browse to the page, the
browser checks for a newer version of the js file. Of course, there is no
way to force the client to get a newer file other then having them do what I
described.

This would mean, that you probably will need to manually maintain this js
file, or have a process that knows how to reconstruct it based on what is in
SQL server periodically. Maybe whatever lets you add members, would then
make sure this file is updated as well.

The filtering you want, is not something going to happen on its own. You
will need to write javascript that will be able to search through the list
of people and filter it, and change the contents of the dropdown. Depending
on how you are storing this data on the client, this can potentially cause a
noticeable delay.

I would recommend having a dialog lookup, which allows a user to filter/do a
search on member, select a member. Selecting a member would close the dialog
and populate the field value on the main page with the selection.

"Paul W" <qq*@qqq.com> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
Hi - I'm developing a 'front-desk' app. to be used over the internet.
(SQL-Server back-end).

One of the pages will require the user to select an entry from a large
(~4000) list of 'member names'.

What are the options to reduce the bandwidth load of this? Is there any
way that I can cache the list on the client (and allow them to
periodically 'refresh' their local copy?). Or, does anyone have some code
for a 'manual' auto-select option where the user can enter the start of
the name (eg. "Wri") into a textbox and the list will be populated with
all matching names?

The list will be called upon many times a day and is relatively static
(~1-2 changes a day).

Thanks for any and all suggestions,

Paul.

Nov 19 '05 #2
If the items in SQL server keep on adding or chaning, for eg 4000 can
become 5000 and so on, then I would suggest to save the data in cache
and reterive it from cache.
When the page loads, you can get this data from SQL server and
reterive it in a DataSet. Then you can save this dataset in cache. You
can set the time of the cache for 10 minutes or 20 minutes. Whenever
the cache is empty, the page will try to get data from SQL server and
will referesh the dataset with new data. Hope that makes sense..here is
the eg:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
If Not (IsPostBack) Then
BuildTable()
End If
End Sub

Private Sub BuildTable()
Dim myCacheData As New DataSet()
myCacheData = GetCacheData()
myDropDownList.DataSource = myCacheData.Tables(0)
myDropDownList.DataTextField = "Column1 '
myDropDownList.DataValueField = "Column2
myDropDownList.DataBind()
End Sub

Private Function GetCacheData() As DataSet
Dim blnResults As Boolean

Dim ds As DataSet = CType(Cache.Get("CodeList "), DataSet)
If ds Is Nothing Then
ds= New DataSet()
'Fill the dataset. Below is the ex from my code..
'blnResults = myServices.GetCode(ds)' In this line
basically fill ur ds with 4000 records from SQl server
If blnResults = True Then
Cache.Insert("CodeList", ds, Nothing,
DateTime.Now.AddMinutes(10), TimeSpan.Zero)
End If
End If
GetCacheData = ds
End Function

Nov 19 '05 #3
Also consider;

+ Making your list hierarchical and using a treeview. More manageable, and
with some work you can make the data load on expansion of a node. More
round trips, but a lot less data per trip. Of course, your data has to be
hierarchically organizable, e.g. by member classification, when they joined,
by location, or some other criteria that is intuitive and useful.

+ Using filters. Marina's partial-text match is a good example; but for
'member names' an A-Z bar could also provide advantages.
"Marina" <so*****@nospam.com> wrote in message
news:u$**************@TK2MSFTNGP14.phx.gbl...
First off, please, under any circumstances, populate a dropdown list with
4000 items. This will be completely useless to the end user.

One way you can cache something like this, is to put the items in a list in a javascript file. So store it in an array, whatever. Include the js file in your .aspx, and pull the list from there. The beauty of js files, is that
every time you open a new browser instance and browse to the page, the
browser checks for a newer version of the js file. Of course, there is no
way to force the client to get a newer file other then having them do what I described.

This would mean, that you probably will need to manually maintain this js
file, or have a process that knows how to reconstruct it based on what is in SQL server periodically. Maybe whatever lets you add members, would then
make sure this file is updated as well.

The filtering you want, is not something going to happen on its own. You
will need to write javascript that will be able to search through the list
of people and filter it, and change the contents of the dropdown. Depending on how you are storing this data on the client, this can potentially cause a noticeable delay.

I would recommend having a dialog lookup, which allows a user to filter/do a search on member, select a member. Selecting a member would close the dialog and populate the field value on the main page with the selection.

"Paul W" <qq*@qqq.com> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
Hi - I'm developing a 'front-desk' app. to be used over the internet.
(SQL-Server back-end).

One of the pages will require the user to select an entry from a large
(~4000) list of 'member names'.

What are the options to reduce the bandwidth load of this? Is there any
way that I can cache the list on the client (and allow them to
periodically 'refresh' their local copy?). Or, does anyone have some code for a 'manual' auto-select option where the user can enter the start of
the name (eg. "Wri") into a textbox and the list will be populated with
all matching names?

The list will be called upon many times a day and is relatively static
(~1-2 changes a day).

Thanks for any and all suggestions,

Paul.


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4135
by: jeff brubaker | last post by:
Hello, Currently we have a database, and it is our desire for it to be able to store millions of records. The data in the table can be divided up by client, and it stores nothing but about 7...
2
829
by: JollyK | last post by:
Hello friends, In a large asp.net project, I don't think it is a good idea for having one common resource file containing all localized strings for the whole application. I think a better...
2
1222
by: Alan Silver | last post by:
Hello, I am writing a page that allows the user to upload two images to the server. I have two HTMLInputFile controls on the page ... <input id="smallimage" Type="File" Runat="Server">...
11
1290
by: Greg Smalter | last post by:
I'm converting some ASP web projects from VS 2003 to VS2005/ASP 2.0. The worst problem I've run into is all references (in codebehind CS files) to UserControls fail. I get the error "The type...
6
4965
by: Eric Chomko | last post by:
I inherited a task which uses a lot of 'ostrstream' in the code. The port is from an SGI box to Sun which is using GNU C++ (g++ version 3.4.2). When trying to compile I get several errors all...
1
1392
by: Dragon | last post by:
Is there any examples of Drag and Drop how to handle in C# ?
10
1552
by: Miro | last post by:
I wanted certain text boxes ( only certain ones ) to always be Trim'd so that spaces are not in the begining, nor the end of the text entered. I created my own "Handle ?" - i hope thats the...
6
2473
by: Kai Zhu | last post by:
I wrote a piece of code to handle drag and drop of DIV element. The code works fine in firefox, but has some problem will IE. We I load the HTML, I can not drag the DIV, and IE seems to be not...
2
5444
by: daniel | last post by:
I have the following scenario. A mysql database running 3 databases. It is version 5.0.27 on Windows XP Prof.. All innodb databases. The one database is particularly large (7.8GB of...
0
2375
by: eduardasm | last post by:
Hello, I have a problem with XML schema update for one XML column (problem exists in both SP1 and SP2 for SQL Server 2005). 1. I have a table that looks like this: CREATE TABLE .( NOT NULL...
0
7254
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5677
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5079
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1585
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.